package cn.imvc.app.models;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import cn.imvc.app.entities.Commission;
import cn.imvc.app.entities.Member;
import cn.imvc.data.domain.ViewRequest;

public interface CommissionModel{
	
	Page<Commission> find(ViewRequest viewRequest);

	Commission get(int id);

	Commission save(Commission entity);

	Commission update(Commission entity);

	void delete(int id);

	void deleteBatch(int[] ids);	
	
	void addCommission(Member member, Byte type, Integer referId);
	
	/**
	 * 查找第N级会员当前页团队业绩
	 * @param member
	 * @param page
	 * @param type
	 * @return
	 */
	Page<Object[]> findPageTeamDetail(Member member, Integer page, String type);
	Page<Object[]> findPageTeamDetail(Member member, Pageable page, String type);
	List<Object[]> findCommPointsByMember(Member member);
	
	/**
	 * 推荐会员分积分，增加分佣，流水记录，修改account
	 * @param member
	 * @param type
	 * @param money
	 * @param formMember
	 */
	void addPointsCommission(Member member, Byte type, Integer money, Member formMember);
	Page<Commission> findOrderPointsByMember(Member member, byte type, Pageable page);
	StringBuffer getMemberStrForDealer(Member member);
	
}